package com.mentaleye.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.mentaleye.dal.dao.TimeTableDao;
import com.mentaleye.dal.model.TimeTable;
import com.mentaleye.dal.model.TimeTableExample;
import com.mentaleye.dal.service.TimeTableMapper;

@Repository
public class TimeTableDaoImpl extends BaseDao implements TimeTableDao{

	@Autowired private TimeTableMapper timeTableMapper;
	
	public boolean insert(TimeTable record){
		return getResultByInt(timeTableMapper.insertSelective(record));
	}
	
	public boolean insertList(List<TimeTable> list){
		return getResultByInt(timeTableMapper.insertList(list));
	}
	
	public boolean delete(Integer id){
		return getResultByInt(timeTableMapper.deleteByPrimaryKey(id));
	}

	public boolean deleteByList(List<Integer> oaclassIds){
		return getResultByInt(timeTableMapper.deleteByList(oaclassIds));
	}
	
	public boolean deleteByExample(TimeTableExample example){
		return getResultByInt(timeTableMapper.deleteByExample(example));
	}
	
	public boolean update(TimeTable record){
		return getResultByInt(timeTableMapper.updateByPrimaryKeySelective(record));
	}

	public boolean updateTeacherByMap(Map<String,Object> map){
		return getResultByInt(timeTableMapper.updateTeacherByMap(map));
	}
	
	public boolean updateByList(List<TimeTable> list){
		return getResultByInt(timeTableMapper.updateDateByList(list));
	}
	
	public boolean updateByExample(TimeTable record,TimeTableExample example){
		return getResultByInt(timeTableMapper.updateByExampleSelective(record, example));
	}
	
	public TimeTable selectByKey(Integer id){
		return timeTableMapper.selectByPrimaryKey(id);
	}
	
	public List<TimeTable> selectByExample(TimeTableExample example){
		return timeTableMapper.selectByExample(example);
	}
	
	public List<TimeTable> selectByBeginTime(Map<String, Object> map){
		return timeTableMapper.selectByBeginTime(map);
	}
	
	public List<TimeTable> selectByClassId(int oaClassId){
		return timeTableMapper.selectByClassId(oaClassId);
	}
	
}
